<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">

    <title>云道控制台</title>

    <link rel="stylesheet" href="/static/css-cus/adminlte.css" />
    <link rel="stylesheet" href="/static/css-cus/fontawesome-all.css" />

    <style>
        .yundao-title{
            margin-left: 20px;
        }

        .list-item-title{
            margin-left: 10px;
        }

        .aside-container{
            max-height: 100%;
            overflow-y: auto;
        }

        .aside-container::-webkit-scrollbar {
            /*滚动条整体样式*/
            width : 10px;  /*高宽分别对应横竖滚动条的尺寸*/
            height: 1px;
        }

        .aside-container::-webkit-scrollbar-thumb {
            /*滚动条里面小方块*/
            border-radius: 10px;
            box-shadow   : inset 0 0 5px rgba(73, 78, 84, 0.2);
            background   : #535353;
        }

        .aside-container::-webkit-scrollbar-track {
            /*滚动条里面轨道*/
            box-shadow   : inset 0 0 5px rgba(73, 78, 84, 0.2);
            border-radius: 10px;
            background   : #ededed;
        }

        #console-frame {
            width: 100%;
            height: 100%;
            border: none;
        }
    </style>
</head>
<body>

    <div class="wrapper">
        <!-- 顶部导航栏 -->
        <nav id="console-nav" class="main-header navbar navbar-expand navbar-white navbar-light">

            <!-- 导航栏左侧内容 -->
            <ul class="navbar-nav">
                <!-- 侧边栏控制按钮 -->
                <li class="nav-item">
                    <a class="nav-link" data-widget="pushmenu" href="#">
                        <i class="fas fa-bars"></i>
                    </a>
                </li>
            </ul>

            <!-- 导航栏右侧区域内容 -->
            <ul class="navbar-nav ml-auto">
                <!-- 消息通知区域，下拉弹出 -->
                <li class="nav-item dropdown">
                    <a id="message" class="nav-link" data-toggle="dropdown" href="#">
                        <i class="fas fa-bell"></i>
                        <span class="badge badge-danger navbar-badge"></span>
                    </a>
                    <div id="messageContainer" class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                        <a href="#" class="dropdown-item">
                            <!-- 消息内容区域 -->
                            <div class="media">
                                <img src="/static/images/yundao-logo-png.png" alt="User Avatar" class="img-size-50 mr-3 img-circle">
                                <div class="media-body">
                                    <p class="text-sm">暂无新消息</p>
                                </div>
                            </div>
                        </a>
                    </div>
                </li>
                <!-- 退出登录 -->
                <li class="nav-item">
                    <a id="logout" class="nav-link" href="#">
                        <span>退出登录</span>
                        <i class="fas fa-sign-out-alt"></i>
                    </a>
                </li>
            </ul>
        </nav>
    </div>

    <!-- 侧边导航栏 -->
    <aside class="main-sidebar sidebar-dark-primary elevation-4 aside-container">
        <!-- 侧边栏顶部logo -->
        <a id="yundao-logo" href="#" class="brand-link">
            <img src="/static/images/yundao-logo-png.png" alt="云道-logo" class="brand-image img-circle elevation-3"
                 style="opacity: 0.8">
            <span class="brand-text font-weight-light yundao-title">云道</span>
        </a>

        <!-- 侧边栏顶部头像 -->
        <div class="sidebar">
            <div class="user-panel mt-3 pb-3 mb-3 d-flex">
                <div class="image">
                    <c:choose>
                        <c:when test="${empty ParentsInfo.avatar}">
                            <img src="/static/images/user-default-avatar.png" class="img-circle elevation-2" alt="User Image">
                        </c:when>
                        <c:otherwise>
                            <c:set var="parentsAvatar" value="/utils/imgDisplay?img=${ParentsInfo.avatar}" scope="page" />
                            <img src="<c:out value="${parentsAvatar}"/>" class="img-circle elevation-2" alt="User Image">
                        </c:otherwise>
                    </c:choose>
                </div>
                <div class="info">
                    <a href="#" class="d-block">
                        <c:choose>
                            <c:when test="${empty ParentsInfo.realName}">
                                <c:out value="${ParentsInfo.name}" />
                            </c:when>
                            <c:otherwise>
                                <c:out value="${ParentsInfo.realName}" />
                            </c:otherwise>
                        </c:choose>
                    </a>
                </div>
            </div>
        </div>

        <!-- 侧边栏菜单项 -->
        <nav id="aside-bar" class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <li class="nav-item has-treeview">
                    <!-- 菜单项被激活 -->
                    <a id="courseManager" href="#" class="nav-link">
                        <i class="nav-icon fas fa-chalkboard-teacher"></i>
                        <p>
                            课程管理
                            <i class="fas fa-chevron-left right"></i>
                        </p>
                    </a>
                    <!-- 菜单项中小项 -->
                    <ul class="nav nav-treeview">
                        <li class="nav-item list-item-title" data-url="my-course">
                            <a id="myCourse" href="#" class="nav-link">
                                <i class="nav-icon fas fa-book-reader fa-xs"></i>
                                <p>我的课程</p>
                            </a>
                        </li>
                        <li class="nav-item list-item-title" data-url="history-course">
                            <a id="historyCourse" href="#" class="nav-link">
                                <i class="nav-icon fas fa-list-alt fa-xs"></i>
                                <p>课程历史</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item has-treeview">
                    <a id="personInfo" href="#" class="nav-link">
                        <i class="nav-icon fas fa-user-tag"></i>
                        <p>
                            个人信息
                            <i class="fas fa-chevron-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item list-item-title" data-url="personalInfo">
                            <a id="infoManager" href="#" class="nav-link">
                                <i class="nav-icon fas fa-user-cog"></i>
                                <p>信息管理</p>
                            </a>
                        </li>
                        <li class="nav-item list-item-title" data-url="notice-manager">
                            <a id="noticeManager" href="#" class="nav-link">
                                <i class="nav-icon fas fa-hourglass-half"></i>
                                <p>通知管理</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item has-treeview">
                    <a id="useHelp" href="#" class="nav-link">
                        <i class="nav-icon fas fa-question-circle"></i>
                        <p>
                            使用帮助
                            <i class="fas fa-chevron-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item list-item-title" data-url="browser-check">
                            <a id="browserHelp" href="#" class="nav-link">
                                <i class="nav-icon fas fa-tv"></i>
                                <p>浏览器兼容性</p>
                            </a>
                        </li>
                        <li class="nav-item list-item-title" data-url="classroom-helper">
                            <a id="classroomHelp" href="#" class="nav-link">
                                <i class="nav-icon fas fa-info-circle"></i>
                                <p>电子教室使用</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item has-treeview">
                    <a id="opinionFeedback" href="#" class="nav-link">
                        <i class="nav-icon fas fa-marker"></i>
                        <p>
                            意见反馈
                            <i class="fas fa-chevron-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item list-item-title" data-url="advice">
                            <a id="giveFeedback" href="#" class="nav-link">
                                <i class="nav-icon fas fa-user-edit"></i>
                                <p>提出意见</p>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </nav>
    </aside>

    <!-- 内容区域 -->
    <div class="content-wrapper aside-container">
        <div class="content">
            <iframe id="console-frame" src="/parents/frame/index"></iframe>
        </div>
    </div>

    <script>
        function changeIframe(url) {
            let frame = document.getElementById("console-frame");
            frame.src = url;
        }
    </script>
    <script src="/static/js-lib/jquery-3.4.1.min.js"></script>
    <script src="/static/js-lib/adminlte.min.js"></script>
    <script src="/static/js-cus/parents/Console.js"></script>
</body>
</html>